tools/libxc: Improve xc_dom_malloc_filemap() error handling
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 25 Nov 2013 11:05:49 +0000 (11:05 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 25 Nov 2013 12:13:08 +0000 (12:13 +0000)
commitc635c1ef7833e7505423f6567bf99bd355101587
tree0407a01a89ec721809a86c5cc7f07221581d8878
parent022d4ee27cee157949ab70c928cbf77d8cda0e3b
tools/libxc: Improve xc_dom_malloc_filemap() error handling

Coverity ID 1055563

In the original function, mmap() could be called with a length of -1 if the
second lseek failed and the caller had not provided max_size.

While fixing up this error, improve the logging of other error paths.  I know
from personal experience that debugging failures function is rather difficult
given only "xc_dom_malloc_filemap: failed (on file <somefile>)" in the logs.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
tools/libxc/xc_dom_core.c